package hoowin.app.wsnd.action;

import hoowin.app.wsnd.service.StatusService;
import hoowin.basic.model.User;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class SaveStatus extends ActionSupport {
	private String statustext;
	private String language;
	private StatusService statusService;
	private String message;
	private User user;
	public String execute(){
		if(statustext==null || statustext.length()==0)return SUCCESS;
		if(statusService.saveStatus(statustext, language, user.getId())){
			return SUCCESS;
		}else{
			setMessage(getText("error.1301"));
			return ERROR;
		}
	}
	public void setStatustext(String statustext) {
		this.statustext = statustext;
	}
	public String getStatustext() {
		return statustext;
	}
	public void setLanguage(String language) {
		this.language = language;
	}
	public String getLanguage() {
		return language;
	}
	public void setStatusService(StatusService statusService) {
		this.statusService = statusService;
	}
	public StatusService getStatusService() {
		return statusService;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getMessage() {
		return message;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public User getUser() {
		return user;
	}
}
